/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb;

import entidades.Materia;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Administrador
 */
@Stateless
public class MateriaFacade extends AbstractFacade<Materia> {
    @PersistenceContext(unitName = "SistemasDistribuidos-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public MateriaFacade() {
        super(Materia.class);
    }

    /*public List<Materia> getCorrelativasByMateria(Materia materia){
        Query query = em.createQuery("SELECT materia FROM Materia materia WHERE materia.idMateria = :idMateria");
        query.setParameter("idMateria", materia.getIdMateria());
        return query.getResultList();
    }*/
}
